package com.example.administrator.sunstart_library;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.TextView;

import java.util.List;

import RecycleViewUtil.SunStartBaseAdapter;
import RecycleViewUtil.ViewHolder;

/**
 * 作者： 孙浩
 * 创建时间： 2017年04月08日17:14
 * 联系方式 QQ：243280864
 * 类注释：
 */

public class SharePopAdapter extends SunStartBaseAdapter {
    public SharePopAdapter(Context context, List<?> list) {
        super(context, list);
    }

    @Override
    public int onCreateViewLayoutID(int viewType) {
        return R.layout.share_rec_adapter;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        MenuPopBean bean = (MenuPopBean) list.get(position);
        TextView tv = holder.getTextView(R.id.share_rec_text);
        tv.setText(bean.getName());
        Drawable drawable = context.getResources().getDrawable(bean.getId());
        drawable.setBounds(0,0,drawable.getMinimumWidth(),drawable.getMinimumHeight());
        tv.setCompoundDrawablePadding(10);
        tv.setCompoundDrawables(null,drawable,null,null);
        tv.setTextColor(context.getResources().getColor(R.color.textBlcak));
    }
}
